package com.easy.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easy.common.bean.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface MenuMapper extends BaseMapper<SysMenu> {

    @Select("select d.* from sys_user_role a right join  sys_role_permission b on a.role_id=b.role_id right  join sys_permission c on b.permission_id=c.id and c.perm_type='MENU' right join sys_permission d on c.menu_id=d.id where a.user_id=#{userid} order by sort_order")
    List<SysMenu> getListByUser(@Param("userid") Integer userid);
}
